<h1><%=@business_title%></h1>
<h2>Libro mayor del periodo <%= @period %> </h2>
<h3>Mes <%=(@foundation_date.month()+(@period.to_i()-1)*@accounting_cycle.to_i) %> del d&iacute;a <%=@foundation_date.day()%></h3>

<table cellpadding="8" cellspacing="0">
  <tr>
      <th>C&oacute;digo</th>    
      <th>Nombre</th>
      <th>Saldo inicial</th>
      <th>Movimiento</th>
      <th>Saldo final</th>
  </tr>
<% for transaction in @total %>
  <tr style="background-color:#89A1D3">

    <td><b><%=transaction[:code]%></b></td>
    <td><b><%=transaction[:name]%></b></td>
    <td><%if transaction[:initial_amount].blank?%>
        <b>$0.00</b>
        <%else%>
        <b><%=transaction[:initial_amount].to_f%></b>
        <%end%>
    </td>
    

    <td><b><%=number_to_currency(transaction[:cash_flow])%></b></td>

     
    <td><b><%=number_to_currency( transaction[:cash_flow].to_f+transaction[:initial_amount].to_f )%></b></td>
  </tr>
  <tr>
  <td>
  </td>
  <td>
    <table  width="800" cellpadding="0" cellspacing="0">
        <tr>
            <th>Fecha</th>
            <th>Asunto</th>
            <th>Cantidad</th>
        </tr>
        <% for t in transaction[:transactions]%>
        <tr style="background-color:#D1EBF5">
        <td><%=t[:date]%></td>
        <td><%=t[:subject]%></td>
        <td><%=number_to_currency(t[:amount])%></td>
        </tr>
        <%end%>

    </table>    
  </td>
  </tr>
  
<%end%>
</table>
<br />
<%=link_to 'Volver', :controller=>'periods'  %>



